home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2004 September / maximum-cd-2004-09.iso / Software / Apps / CorelDRAWGraphicsSuite12.exe / CorelDRAW Graphics Suite 12.msi / Binary.NewBinary30 < prev    next >
Encoding:
Text File  |  2004-01-07  |  5.3 KB  |  170 lines

  1. Const msiNoAction = -1
  2. Const msiInstallStateAdvertise = 1
  3. Const msiInstallStateAbsent = 2
  4. Const msiInstallStateLocal = 3
  5. Const msiInstallStateSource = 4
  6. Const msiInstallStateDefault = 5
  7. Dim nRemoveVBAEN:nRemoveVBAEN = 0
  8. Dim nRemoveVBACZ:nRemoveVBACZ = 0
  9. Dim nRemoveVBANL:nRemoveVBAPL = 0
  10.  
  11. On Error Resume Next
  12.     
  13.  
  14. If (IsFeatureExists("EN") = 1) Then
  15.     If (Session.Property("ENLANG") = "1") Then
  16.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  17.             Session.FeatureRequestState("English") = msiInstallStateLocal
  18.         End If
  19.     Else 
  20.         Session.FeatureRequestState("English") = msiInstallStateAbsent        
  21.     End if
  22. End If
  23. If (IsFeatureExists("FR") = 1) Then
  24.     If (Session.Property("FRLANG") = "1") Then
  25.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  26.             Session.FeatureRequestState("French") = msiInstallStateLocal
  27.         End If
  28.     Else
  29.             Session.FeatureRequestState("French") = msiInstallStateAbsent
  30.     End If
  31. End If
  32. If (IsFeatureExists("DE") = 1) Then
  33.     If (Session.Property("DELANG") = "1") Then
  34.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  35.             Session.FeatureRequestState("German") = msiInstallStateLocal
  36.         End If
  37.     Else
  38.         Session.FeatureRequestState("German") = msiInstallStateAbsent
  39.     End If
  40. End If
  41. If (IsFeatureExists("JP") = 1) Then
  42.     If (Session.Property("JPLANG") = "1") Then
  43.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  44.             Session.FeatureRequestState("Japanese") = msiInstallStateLocal
  45.         End If
  46.     Else
  47.         Session.FeatureRequestState("Japanese") = msiInstallStateAbsent
  48.     End If
  49. End If
  50. If (IsFeatureExists("IT") = 1) Then
  51.     If (Session.Property("ITLANG") = "1") Then
  52.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  53.             Session.FeatureRequestState("Italian") = msiInstallStateLocal
  54.         End If
  55.     Else
  56.         Session.FeatureRequestState("Italian") = msiInstallStateAbsent
  57.     End If
  58. End If
  59. If (IsFeatureExists("ES") = 1) Then
  60.     If (Session.Property("ESLANG") = "1") Then
  61.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  62.             Session.FeatureRequestState("Spanish") = msiInstallStateLocal
  63.         End If
  64.     Else
  65.         Session.FeatureRequestState("Spanish") = msiInstallStateAbsent
  66.     End If
  67. End If
  68. If (IsFeatureExists("BP") = 1) Then
  69.     If (Session.Property("BPLANG") = "1") Then
  70.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  71.             Session.FeatureRequestState("Portuguese") = msiInstallStateLocal
  72.         End If
  73.     Else
  74.         Session.FeatureRequestState("Portuguese") = msiInstallStateAbsent
  75.     End If
  76. End If
  77. If (IsFeatureExists("NL") = 1) Then
  78.     If (Session.Property("NLLANG") = "1") Then
  79.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  80.             Session.FeatureRequestState("Dutch") = msiInstallStateLocal
  81.         End If
  82.     Else
  83.         Session.FeatureRequestState("Dutch") = msiInstallStateAbsent
  84.     End If
  85. End If
  86. If (IsFeatureExists("PL") = 1) Then
  87.     If (Session.Property("PLLANG") = "1") Then
  88.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  89.             Session.FeatureRequestState("Polish") = msiInstallStateLocal
  90.         End If
  91.     Else
  92.         Session.FeatureRequestState("Polish") = msiInstallStateAbsent
  93.     End If
  94. End If
  95.  
  96. If (nRemoveVBAEN = 1) And (nRemoveVBAPL = 1) And (nRemoveVBACZ = 1) Then
  97.     Session.FeatureRequestState("VBAEN") = msiInstallStateAbsent
  98. End If
  99.  
  100. '///////////////////////////////////////////////////////////////////////////
  101. Function IsFeatureExists(sFeature)
  102. On Error Resume Next
  103.  
  104.     Dim objDB: Set objDB = Session.Database
  105.  
  106.     Dim sQuery: sQuery = "SELECT * FROM `Feature` WHERE `Feature`.`Feature` = '" & sFeature & "'"
  107.  
  108.     Dim objView: Set objView = objDB.OpenView(sQuery)
  109.     objView.Execute
  110.  
  111.     Dim objRec: Set objRec = objView.Fetch
  112.  
  113.     If (objRec Is Nothing) Then
  114.         ' not there
  115.         IsFeatureExists = 0
  116.     Else
  117.         ' there
  118.         IsFeatureExists = 1
  119.     End If
  120.  
  121. End Function
  122.  
  123. '*********************************************************************************************
  124. '    Function:    getFeatureAction(sFeature)
  125. '
  126. '    Args:        STRING sFeature = `Feature`.`Feature`
  127. '
  128. '    Returns:    The current install state of the feature
  129. '
  130. '*********************************************************************************************
  131. Function getFeatureState(sFeature)
  132. On Error Resume Next
  133.     getFeatureState = Session.FeatureCurrentState(sFeature)
  134. End Function
  135.  
  136. '*********************************************************************************************
  137. '    Function:    getFeatureAction(sFeature)
  138. '
  139. '    Args:        STRING sFeature = `Feature`.`Feature`
  140. '
  141. '    Returns:    The requested action of the feature
  142. '
  143. '*********************************************************************************************
  144. Function getFeatureAction(sFeature)
  145. On Error Resume Next
  146.     getFeatureAction = Session.FeatureRequestState(sFeature)
  147. End Function
  148.  
  149.  
  150. '*********************************************************************************************
  151. '    Function:    IsFeatureSelected(sFeature)
  152. '
  153. '    Args:        STRING sFeature = `Feature`.`Feature`
  154. '
  155. '    Returns:    True \ False
  156. '
  157. '    Notes:        Determines if a feature is selected for install
  158. '*********************************************************************************************
  159. Function IsFeatureSelected(sFeature)
  160. On Error Resume Next
  161.     Dim nState: nState = getFeatureState(sFeature)
  162.     Dim nAction: nAction = getFeatureAction(sFeature)
  163.  
  164.     If ((nAction > msiInstallStateAbsent) Or ((nState > msiInstallStateAbsent) And (nAction = msiNoAction))) Then
  165.         IsFeatureSelected = True
  166.     Else
  167.         IsFeatureSelected = False
  168.     End If
  169.  
  170. End Function